Skip to content

Conversation

@HassanOHOsman
Copy link

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

This PR contains my solutions to all the "Prep Exercises" in Sprint 5 of the "Tools" module.

@HassanOHOsman HassanOHOsman added 📅 Sprint 5 Assigned during Week 5 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 8, 2025
@LonMcGregor
Copy link

There are a lot of files comitted here, can you take a look and figure out why that is happening?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jan 14, 2026
@HassanOHOsman
Copy link
Author

There are a lot of files comitted here, can you take a look and figure out why that is happening?

Yes, I just ignored the .venv so that it's easy for you to navigate through. Please let me know if you need anything else :)

@HassanOHOsman HassanOHOsman added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jan 14, 2026
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work on these tasks, there are just two of them I have suggestions for improvements in

def print_family_tree(person: Person) -> None:
print(person.name)
for child in person.children:
print(f"- {child.name} ({child.age})")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This correctly prints out this person's children. Do you think there is a way to make it print out the whole family tree?

(hint: recursion)

Copy link
Author

@HassanOHOsman HassanOHOsman Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!
The current code actually does print the whole family tree (the parent: Imran and the 2 children Fatima & Aisha as per my examples). I've attached a screenshot. Nevertheless, if you still think it's better to be done through the recursion approach please let me know. Thank you! :)
Screenshot 2026-01-21 at 23 31 36

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this task so far. I was thinking about if, for example in that screenshot, if Aisha had a child as well (i.e. Imran's grandchild). Could you design the function in such a way that it could print that out as well? Recursion might help here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now understand. Thank you for clarifying. Done as instructed. Please review and let me know if there's anything else that needs improving. I appreciate you help :)

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jan 19, 2026
@HassanOHOsman HassanOHOsman added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jan 21, 2026
@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jan 26, 2026
@HassanOHOsman HassanOHOsman added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 5 Assigned during Week 5 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants